<?php
$loader->requireOnce('includes/PatientQueue/AbsQueue.class.php');
$loader->requireOnce('includes/OutPatientFlow/OutPatientFlowProcessor.class.php');
/**
 * Controller HIS Doctor actions
 */
class C_Doctor extends Controller {
	
	const DEFAULT_PAGE_SIZE = 5;
	const DEFAULT_PAGE 		= 1;
	
	var $currentDoctorId;
	
    function C_Doctor ($template_mod = "general") {
        parent::Controller();
    	if (Celini::getCurrentController() == 'Doctor') {
			$menu =& Menu::getInstance();
			$menu->currentSection = 'patient';
		}
        $this->template_mod = $template_mod;
        $this->view->path = 'doctor';
        $this->currentDoctorId = $this->_me->get_person_id();
    }

    public function actionViewWorkspace(){
    	$this->assign('index', 1);
    	$this->assign('patientList', Celini::newOrdo('Ticket')->getPatientList('day'));
    	return $this->view->render('view_workspace.html');
    }
    
    public function actionGetPatientList() {
        $timeRange = $_GET['timeRange'];
        
        if ($timeRange != 'day' &&
             $timeRange != 'week' &&
              $timeRange != '2week' &&
               $timeRange != 'month') {
            return -1;
        }
        
        $this->assign('index', 1);
        $this->assign('patientList', Celini::newOrdo('Ticket')->getPatientList($timeRange));
        return $this->view->render('patient_list.html');
    }
}
?>